//
//  MNDPhotoBrowserCell.m
//  minidai
//
//  Created by 谭伟 on 2017/4/27.
//  Copyright © 2017年 迷你金服. All rights reserved.
//车辆图片展示cell

#import "MNDPhotoBrowserCell.h"
@interface MNDPhotoBrowserCell()


@end
@implementation MNDPhotoBrowserCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.scroview = [[UIScrollView alloc]initWithFrame:self.bounds];
//    [self addSubview:self.scroview];
    [self.photoImgView addGestureRecognizer:[[UIPinchGestureRecognizer alloc]initWithTarget:self action:@selector(zoomScalePhotoPinchGesture:)]];
}

- (void)setPhotoImg:(UIImage *)photoImg {
    _photoImg = photoImg;
    self.photoImgView.image = photoImg;
    self.photoImgView.userInteractionEnabled = YES;
    self.photoImgView.contentMode = UIViewContentModeScaleToFill;
}

//缩放照片
- (void)zoomScalePhotoPinchGesture:(UIPinchGestureRecognizer *)pinchGesture {
//    CGFloat scale = pinchGesture.scale;
//    self.photoImgView.transform = CGAffineTransformScale(self.photoImgView.transform, scale, scale);
//    self.transform = CGAffineTransformScale(self.photoImgView.transform, scale, scale);
//    self.scroview.transform = CGAffineTransformScale(self.photoImgView.transform, scale, scale);
//    //重设scale
//    pinchGesture.scale = 1.0;
//    self.scroview.contentSize = CGSizeMake(self.scroview.contentSize.width *scale, self.scroview.contentSize.height *scale);
}
@end
